package com.kycq.viewpager.fragment.normal;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;

import com.kycq.viewpager.R;
import com.kycq.viewpager.databinding.ActivityNormalPagerBinding;

public class NormalPagerActivity extends AppCompatActivity {
	private static String TAG = NormalPagerActivity.class.getSimpleName();

	private ActivityNormalPagerBinding mDataBinding;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		System.out.println(TAG + " onCreate " + savedInstanceState);

		mDataBinding = DataBindingUtil.setContentView(this, R.layout.activity_normal_pager);
		mDataBinding.viewPager.setAdapter(new NormalPagerAdapter(getSupportFragmentManager()));
		mDataBinding.tabLayout.setupWithViewPager(mDataBinding.viewPager);
	}

	@Override
	protected void onSaveInstanceState(Bundle outState) {
		super.onSaveInstanceState(outState);
		System.out.println(TAG + " onSaveInstanceState " + outState);
	}

	@Override
	protected void onRestoreInstanceState(Bundle savedInstanceState) {
		super.onRestoreInstanceState(savedInstanceState);
		System.out.println(TAG + " onRestoreInstanceState " + savedInstanceState);
	}

	@Override
	protected void onStart() {
		super.onStart();
		System.out.println(TAG + " onStart");
	}

	@Override
	protected void onResume() {
		super.onResume();
		System.out.println(TAG + " onResume");
	}

	@Override
	protected void onPause() {
		super.onPause();
		System.out.println(TAG + " onPause");
	}

	@Override
	protected void onStop() {
		super.onStop();
		System.out.println(TAG + " onStop");
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
		System.out.println(TAG + " onDestroy");
	}
}
